package com.example.sequences.dao;

import com.example.sequences.domain.Student;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

/**
 * PersonDao
 *
 * @author maxsc
 * @title PersonDao.java
 * @date 2018/5/8
 */
@Repository
public interface StudentDao extends JpaRepository<Student,String> {
    @Modifying
    @Query(value = "update Student p set p.grade =:grade, p.score=:score where p.name=:name")
    void updateStu(@Param("grade") String grade,@Param("score") String score, @Param("name") String name);
}
